<template>
	<view class="mine">
		<view class="bg">
			<view class="codeImg" @click="goTo('/pages/create/myQrCode')"><i></i></view>
			<view class="info">
				<view @tap="goTo('/pages/setUp/setUp')"><up-avatar class="picture" mode="aspectFill" :src="info.picture"
						size="90">
					</up-avatar></view>
				<view>{{ info.nick_name }}</view>
				<view @tap="copyText(info.id_no)">ID： {{ info.id_no }}</view>
			</view>
		</view>

		<view class="balance" @tap="goTo('/pages/myWallet/myWallet')">
			<view>
				<view>当前可用余额</view>
				<view>{{ balance }}</view>
			</view>
			<view>
				<view>充值提现</view>
			</view>
		</view>
		<view class="myServices">
			<view class="title">我的服务</view>
			<view class="list">
				<view>
					<view>语言切换</view>
					<view>
						<language />
					</view>
				</view>
				<view @tap="goTo('/pages/pay/pay')">支付设置</view>
				<!--#ifdef H5-->
				<view class="downLoadApp" @tap="goTo('/pages/mine/downLoad')">下载APP</view>
				<!--#endif-->
				<view  class="changeLoginPassword"  @tap="goTo('/pages/pay/changeLoginPassword')">修改登录密码</view>
				<view  class="setUp"  @tap="goTo('/pages/setUp/setUp')"> 设置</view>
			</view>
		</view>
	</view>
</template>

<script setup lang="ts">
	import { ref } from "vue";
	import { onShow } from "@dcloudio/uni-app";
	import { UserInfo, UserMoney } from "@/api/UserApi";
	import { FriendApply } from "@/api/ImApi";

	onShow(() => {
		UserInfoFn();
		UserMoneyFn();
		FriendApply()
	});
	// 获取用户信息
	let info = ref<any>();
	const UserInfoFn = async () => {
		info.value = uni.getStorageSync("userInfo");
		info.value = await UserInfo();
		console.log(info.value)
	};

	let balance = ref<number>(0);
	const UserMoneyFn = async () => {
		balance.value = uni.getStorageSync("balance");
		balance.value = await UserMoney();
	};
</script>
<style scoped lang="scss">
	@import "../../static/scss/mine.scss";
</style>